Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

132
Vistas
Why is {" "} automatically inserted in my React app?

I have a React application, and sometimes I see {" "} automatically being added in my source code. Can anyone help me understand why this is happening? It's not creating any error or bug in application, what's the reason behind it?

For example:

<div className="pr-form display-block">
  <input
    type="radio"
    name="same"
    onChange={handleChange("create")}
    defaultValue={values.create}
  />{" "}
  Create a new requirement
  <br />
  <input
    type="radio"
    name="same"
    onChange={handleChange("reuse")}
    defaultValue={values.reuse}
  />{" "}
  Reuse a draft
  <br />
  <input
    type="radio"
    name="same"
    onChange={handleChange("existing")}
    defaultValue={values.existing}
  />{" "}
  Using an existing requirement
</div>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Probably you have plugin eslint-plugin-react installed so It automatically add curly braces to whitespace when file saved Alternatively, we can use &nbsp;(non-breaking spaces), <span> </span> or \u00A0 You can read more about this rule here rules/jsx-curly-brace-presence

Examples of correct code for this rule:

<Color text={"\u00a0"} />
<App>{"Hello \u00b7 world"}</App>;
<style type="text/css">{'.main { margin-top: 0; }'}</style>;
/**
 * there's no way to inject a whitespace into jsx without a container so this
 * will always be allowed.
 */
<App>{' '}</App>
<App>{'     '}</App>
<App>{/* comment */ <Bpp />}</App> // the comment makes the container necessary 
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda